package com.job.ZhangMeng.Homework0711;

public class TestPresident {
    public static void main(String[] args) {

        final double PI=3.14;//final修饰局部变量，则该变量转化为常量
        //PI=3.15;无法赋值

        //President pre=new President();无法调用
        President p1=President.getInstance();
        President p2=President.getInstance();
        President p3=President.getInstance();
        System.out.println(p1==p2 && p2==p3 && p1==p3);

        //同一实例，对象的地址相同
        p1.setName("安安");
        System.out.println("p1:"+p1.getName());
        System.out.println("p2:"+p2.getName());
        System.out.println("p3:"+p3.getName());

    }
}
